﻿using Domain.MainModule.Entities;
using Domain.MainModule.Repositories;
using Infrastructure.Data.Core;
using Infrastructure.Data.MainModule.UnitOfWork;

namespace Infrastructure.Data.MainModule.Repositories
{
    public class CustomerRepository : Repository<Customers,int>, ICustomerRepository
    {
        public CustomerRepository(IQueryableUnitOfWork unitOfWork) : base(unitOfWork) { }

        public override Customers Get(int id)
        {
            var context = this.UnitOfWork as MainModuleUnitOfWork;
            if (context != null)
            {
                return context.CreateSet<Customers>().Find(id);
            }
            return null;
        }
    }
}
